package com.qiaoya;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import com.qiaoya.deviceProxy.MsgLinkService;
import com.qiaoya.nettyConnProxy.NettyConnProxy;
/**
 * SpringBoot-MyBatis Application.
 *
 * @author Xiaoyue Xiao
 */
@Configuration
@ComponentScan
@EnableAutoConfiguration
@SpringBootApplication
//@ComponentScan("com.qiaoya.deviceProxy")
public class Application extends SpringBootServletInitializer {
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(Application.class);
	}

	public static void main(String[] args) throws Exception {
		SpringApplication.run(Application.class, args);
		//启动mina服务
		//startIOTCONN();
		System.out.println("IOT Server Starting!^^^^(^^^)^^^^");
//		MsgLinkService msgService = new MsgLinkService();
//		msgService.linkStart();
		NettyConnProxy nettyConnProxy = new NettyConnProxy();
		nettyConnProxy.linkStart();
	}
}
